\documentclass[10pt]{report}
\usepackage{amsmath}

\begin{document}
\title{imu notes}
\author{Janne Olavi Paanajärvi}
\maketitle

\chapter{Rotation representations}

Rotation can be represented as a 3x3 matrix
\begin{equation}\label{eq:R}
R=\left[\begin{array}{ccc}
   r_{11} &r_{12} &r_{13}\\
   r_{21} &r_{22} &r_{23}\\
   r_{31} &r_{32} &r_{33}
  \end{array}\right]
\end{equation}
but there are only 3 free parameters in rotation matrix. One minimal representation is
the skew symmetric matrix

\begin{equation}\label{eq:S}
S=\left[\begin{array}{ccc}
   0 &-s_z &s_y\\
   s_z &0 &-s_x\\
   -s_y &s_x &0
  \end{array}\right]
\end{equation}

the corresponding rotation matrix is

\begin{equation}\label{eq:RS}
R=e^S
\end{equation}

this can be calculated in closed form with the Rodrigues formula. Another minimal representation is the euler angles.
 In euler angle representation the rotation consists of three consequtive rotations along different axis.

Quaternions can also used to represent rotations. A quaternion has four parameters meaning that it has one
more than the minimal parametrisation. The quaternion parametrisation of rotation matrix is
\begin{equation}\label{eq:qR}
R=\left[\begin{array}{ccc}
   {q_1}^2+{q_2}^2-{q_3}^2-{q_4}^2 &2\left(q_2q_3-q_1q_4\right) &2\left(q_2q_4+q_1q_3\right)\\
   2\left(q_2q_3+q_1q_4\right) &{q_1}^2-{q_2}^2+{q_3}^2-{q_4}^2 &2\left(q_3q_4-q_1q_2\right)\\
   2\left(q_2q_4-q_1q_3\right) &2\left(q_3q_4+q_1q_2\right) &{q_1}^2-{q_2}^2-{q_3}^2+{q_4}^2
  \end{array}\right]
\end{equation}

Quaternion representation can be directly calculated from the skew matrix representation as follows. First calculate
the angle of rotation 
\begin{equation}\label{eq:theta}
\theta=\sqrt{{s_x}^2+{s_y}^2+{s_z}^2}
\end{equation}
 the axis is then 

\begin{equation}\label{eq:omega}
\omega=\left[\begin{array}{ccc} \frac{s_x}{\theta} &\frac{s_y}{\theta} &\frac{s_z}{\theta} \end{array}\right]
\end{equation}

 the quaternion is then calculated as follows. The first parameter is 
\begin{equation}\label{eq:q1}
q_1=\cos{\left(\theta/2\right)}
\end{equation}
the rest are 
\begin{equation}\label{eq:q234}
\left[\begin{array}{c} q_2 \\ q_3\\ q_4 \end{array}\right]=\left[\begin{array}{c} \sin{\left(\theta/2\right)}\omega_1 \\ \sin{\left(\theta/2\right)}\omega_2\\ \sin{\left(\theta/2\right)}\omega_3 \end{array}\right]
\end{equation}
\chapter{Acceleration prediction}
The measured acceleration consists of the gravity vector projected to the sensor coordinates, acceleration and noise.

\begin{equation}\label{eq:acc}
a_{imu}=Ra_{world}+R\left[\begin{array}{ccc}0 &0 &g\end{array}\right]^T
\end{equation}
 
\end{document}